home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / ibm / ashc5.arc / READSRC.TXT < prev    next >
Text File  |  1990-12-24  |  13KB  |  260 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                             Motorola's Freeware Assemblers
  7.                                     "Version 1.2"
  8.  
  9.  
  10.                  Welcome to "Version 1.2" of Motorola's Freeware
  11.           Assemblers.  I've put the version number in quotes because I'm
  12.           not certain that anyone's been keeping track...  I consider the
  13.           correction and enhancements made by Bruce Olney as Version 1.1,
  14.           so I'm calling my contribution "Version 1.2".  My contribution
  15.           consists of activation of the END directive, corrected forward
  16.           reference handling, allowance of long file or path names (MAC
  17.           users, this may help you), improved handling of multiple source
  18.           files, improved error detection and reporting (both input code
  19.           and assembler operation), allowance of a little more leeway in
  20.           operand syntax, and some miscellaneous changes.
  21.                  This file contains a more detailed listing of the changes 
  22.           mentioned above, as well as some corrections for another file 
  23.           you'll want:  ASREF.MAN.  ASREF.MAN is the manual for the 
  24.           freeware assemblers.  Look for ASREF.ARC, which can be "de-
  25.           archived" with PKXARC to yield ASREF.MAN.  If you're using an IBM 
  26.           PC or compatible and don't want to compile the assemblers 
  27.           yourself, look for FASPC1P2.ARC.  It contains the assemblers 
  28.           ready-to-use (compiled with QuickC 2.0 using compact memory 
  29.           model, except was ASHC5 compiled with QuickC 2.5).  Hopefully, a 
  30.           generous MAC user will upload an archive of the assemblers 
  31.           compiled for the MAC.  I'll take the liberty of suggesting the 
  32.           name FASMA1P2.ARC.  The file ASEMBLER.DOC (included in the 
  33.           archive you got this file from) contains a brief rundown on the 
  34.           freeware assemblers for those acquainted with Motorola's other 
  35.           development products.  I have edited ASEMBLER.DOC only a little; 
  36.           it does not include much of the information presented here. 
  37.                  I have used good 68HCx05 code to test AS5, so it should be
  38.           nearly bug free.  Since most of the code is common to all the
  39.           assemblers, the others should be in reasonably good shape but
  40.           are untested.  If you discover bugs, please report them on
  41.           Motorola's Freeware BBS.  If you wish to contact me about these
  42.           assemblers, I may be reached (in order of preference) on
  43.  
  44.                  Motorola's Freeware BBS       (512) 891-3733
  45.                  the JDR Microdevices BBS      (408) 559-0253
  46.                  or the Radio-Electronics BBS  (516) 293-2283
  47.  
  48.                  The files AS0.C, AS1.C, AS4.C, AS5.C, ASHC5.C, AS9.C, and 
  49.           AS11.C are used to compile the assemblers.  Each of these files 
  50.           acts as a list of the source files to use for its version of the 
  51.           assemblers.  Either copy all of the .C files and all of the .H 
  52.           files to the disk or directory you want to compile on, or copy 
  53.           only the AS*.C file you want and the files mentioned in it to the 
  54.           disk or directory you want to compile on.  Then tell your C 
  55.           compiler to compile the AS*.C file; the others will be read in 
  56.           automatically.  If you're working on an 80x86 machine (IBM PC or 
  57.           Clone) you should use either the small or compact memory model. 
  58.           The small model provides slightly smaller program size and 
  59.           slightly faster execution, while the compact model provides more 
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.           space for the assemblers to store data.
  73.                  Thank you to all who have worked on these assemblers
  74.           before me, and best wishes to all who use them.  Just in case any
  75.           copyright worries should pop up, I hereby release to the public
  76.           domain this document and all of the changes and I have written
  77.           into these assemblers.
  78.  
  79.                                                  Greg Thoman
  80.                                                  1990 December 24
  81.  
  82.  
  83.           THE END DIRECTIVE
  84.  
  85.                  Past versions of the assemblers ignored the END directive.
  86.           Now, END terminates assembly of the current source file without
  87.           affecting assembly of subsequent source files and lets you
  88.           specify your program's entry point.  The syntax is:
  89.  
  90.           [label]   END [expression]  [;comment]
  91.  
  92.           where the brackets indicate optional items and are NOT included
  93.           in your code.  The label follows the same rules as all other
  94.           labels:  it must start in the first column, must begin with a
  95.           letter, an underscore, or a period, and may contain letters,
  96.           digits, underscores, periods, and dollar signs.  The expression,
  97.           if used, sets your program's entry point.  Thus, it will usually
  98.           be a program label; however, it can be any valid expression that
  99.           evaluates to the address you want.
  100.                  Comments following the END directive should start with a
  101.           semicolon to prevent confusion in case there's no expression to
  102.           evaluate.  The expression evaluator will probably find a comment
  103.           distasteful.
  104.                  You may use the END directive at the end of each source
  105.           file in a group, and may use it more than once in the same file
  106.           (the first END will stop assembly of that file, so the assembler
  107.           will never see any later ENDs).  If the assembler encounters END
  108.           with an expression more than once you'll get a warning if the
  109.           expressions evaluate to the same address.  If the expressions
  110.           evaluate to different addresses, you'll get an error.
  111.  
  112.  
  113.           FORWARD REFERENCE HANDLING
  114.  
  115.                  The assemblers were deleting the forward reference file
  116.           before attempting to use it.  "Version 1.2" deletes the forward
  117.           reference file after assembly is finished.  This may reduce the
  118.           number of "phasing errors" you run into, but they'll still be
  119.           around.
  120.  
  121.  
  122.           LONG FILE OR PATH NAMES
  123.  
  124.                  The assemblers now attempt to use your C compiler's
  125.           definition of FILENAME_MAX to set the filename buffer size.
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.           I believe this is an ANSI item and may not be defined on non-ANSI
  139.           compilers.  If FILENAME_MAX is not defined by your compiler, the
  140.           assemblers will use their maximum buffer size (512 bytes in
  141.           "Version 1.2").  Thus, you should be able to use full path names
  142.           and work among subdirectories.
  143.                  This may help MAC users who have had to run the assemblers
  144.           from the root "folder" of a floppy drive.  Try it out!
  145.  
  146.  
  147.           MULTIPLE SOURCE FILES
  148.  
  149.                  The assembler now outputs the message "  Assembling <file
  150.           name>", where <file name> is the name of the file about to be
  151.           assembled, as it begins assembly of each file in pass 2.  If you
  152.           are having the assembler create a listing file, these messages
  153.           will break the listing file up so you can see which source file
  154.           is which.
  155.                  Warnings and error messages now report the line number
  156.           within the source file where a problem was found instead of the
  157.           cumulative line number.  This makes error correction easier.  The
  158.           listing, cross reference, and symbol table use the cumulative
  159.           line number.
  160.  
  161.  
  162.           ERROR DETECTION AND REPORTING
  163.  
  164.                  Error and warning messages always give the name of the
  165.           source file where a problem was found.
  166.                  Some error messages are now less cryptic, and error
  167.           messages always start with "Error".
  168.                  Use of NUL as a character constant now generates an error
  169.           message.
  170.                  The assemblers now count the number of warnings issued and
  171.           output it after assembly.
  172.                  Warnings are output on both passes.  If you're generating
  173.           a listing, it will start with a list of warning messages and each
  174.           suspect line will be accompanied by its warning message.
  175.                  The assemblers now warn of over-length labels and error on
  176.           over-length mnemonics or directives.
  177.                  Any unrecognized option on the command line is a fatal
  178.           error, and the assembler will output a list of allowed options.
  179.                  All memory allocation operations are checked for failure.
  180.                  All file operations are checked for failure.
  181.  
  182.  
  183.           OPERAND SYNTAX
  184.  
  185.                  Character constants are now allowed to have a closing
  186.           single quote.  Thus, 'a and 'a' are the same to the assemblers.
  187.                  The OPT directive now allows multiple options, as
  188.           described in ASREF.MAN.
  189.                  The assemblers now allow comma-delimited lists to contain
  190.           whitespace after each comma.  Thus, "OPT NOL,C" is the same as
  191.           "OPT NOL, C".  This also works for data initialization and MC6811
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.           register lists.  Note that as always, whitespace is NOT allowed
  205.           in indexed addressing.  "LDA DOG,X" is legal, while "LDA DOG, X"
  206.           is not.
  207.                  Except for AS4 and certain 6809 instructions, the
  208.           assemblers interpret an operand consisting only of an index
  209.           register as a request for zero-offset indexed addressing.  Thus,
  210.           "LDA X", "LDA ,X", and "LDA 0,X" all mean to load register A with
  211.           the value whose address is in the X register.  On the 6804 the
  212.           registers are memory locations, so the comma is required to
  213.           prevent confusion.  On the 6809, pushes and pulls interpret a
  214.           register alone as that register, not indexed addressing.
  215.                  Arguments to the OPT directive may now be upper case,
  216.           lower case, or mixed case.
  217.                  The semicolon may be used to start a comment almost
  218.           anywhere on a line.  Unless the semicolon is the first character
  219.           on the line at least one whitespace character should precede it.
  220.           The semicolon does NOT act as a comment starter if it can be
  221.           interpreted as an argument to an FCC directive or if it is
  222.           immediately preceded by a single quote ( '; is a character
  223.           constant, not the start of a comment).
  224.  
  225.  
  226.           MISCELLANEOUS
  227.  
  228.                  Line continuation with the backslash character has
  229.           apparently never existed in these assemblers.  I have not added
  230.           it.
  231.                  When the assemblers truncate listing of a long data group,
  232.           they add a note to the listing to tell you.
  233.                  The buffer size in "Version 1.2" is 512 bytes.  This will
  234.           allow lines up to 510 characters (last two bytes are taken up by
  235.           the line's carriage return and an end-of-string marker).  The
  236.           assemblers will choke on longer lines.
  237.                  When the assemblers encounter "OPT NOC" while listing,
  238.           they output the cumulative cycle count to that point.  The
  239.           cumulative cycle count is also output after the last source line
  240.           if cycle counting is still enabled.
  241.                  AS9 allows TFR from a 16 bit register to an 8 bit
  242.           register, as described in ASREF.MAN.
  243.                  If you want to use the assemblers on an 8 bit machine you
  244.           ought to change all of the data items declared as "int" to
  245.           "short" so that they'll still be long enough for various overflow
  246.           checks to work (unfortunately, this will slow processing).  If
  247.           you use a 32 bit machine and compiler or change some "int" items
  248.           to "long", you'll get a warning if the entry point specified with
  249.           END overflows 16 bits.
  250.  
  251.  
  252.           SOME ASREF.MAN CORRECTIONS
  253.                  Page 6:   Parentheses are NOT allowed in expressions.
  254.                  Page 10:  The "no listing" option is nol, not no, and is
  255.           the default.
  256.                  Page 14:  The contc option continues a previously stopped
  257.           cycle count and is not listed in ASREF.MAN.
  258.                  Page 20:  The predefined constants for register addresses
  259.           on the 6804 are A, X, & Y, not A, B, & C.
  260.